f1 = fopen('Z:\phd\tex\year.txt','rt');
f2 = fopen('Z:\phd\tex\authors.txt','rt');
f3 = fopen('Z:\phd\tex\title.txt','rt');
f4 = fopen('Z:\phd\tex\journals.txt','rt');
f5 = fopen('Z:\phd\tex\volume.txt','rt');
f6 = fopen('Z:\phd\tex\pages.txt','rt');
fid = fopen('Z:\phd\tex\phd_manoj.bib','wt');

for i = 1:130,
    year = deblank(fgets(f1));
    authors = deblank(fgets(f2));
    title = deblank(fgets(f3));
    journal = deblank(fgets(f4));
    volume = deblank(fgets(f5));
    pages = deblank(fgets(f6));
    
    
    if length(year) >0 & length(authors) >0 & length(title)>0,
    fprintf(fid,'\\@Article{%s%s,\n',authors(1:3),year(end-1:end));
    fprintf(fid,'   author  = {%s},\n',authors);
    fprintf(fid,'   title   = {%s},\n',title);
    fprintf(fid,'   journal = {%s},\n',journal);
    fprintf(fid,'   volume  = {%s},\n',volume);
    fprintf(fid,'   pages   = {%s},\n',pages);
    fprintf(fid,'   year    = {%s}\n',year);
    fprintf(fid,'}\n');

    %disp([authors year title journal volume pages]);
    
else,
    disp('Warning');
    disp(i);
end;
   % clear year authors title pages volume journal;
end;
fclose all;


